/*******************************************************************************
 * Copyright (c) 2010, 2030 www.mahao.cn
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 *******************************************************************************/
package cn.itlaobing.springaop.advice;

import java.lang.reflect.Method;
import java.util.Arrays;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.aop.AfterReturningAdvice;
import org.springframework.aop.MethodBeforeAdvice;

/** 
 * ClassName: LogAdvice <br/> 
 * Function: TODO 功能描述 <br/> 
 * date: 2017年6月6日 下午3:23:14 <br/> 
 * 
 * @author Mmmmm 
 * @version  
 * @since JDK 1.8 
 */
public class LogAdvice implements MethodBeforeAdvice, AfterReturningAdvice {
	
	Log log =LogFactory.getLog(LogAdvice.class);

	@Override
	public void before(Method method, Object[] args, Object target) throws Throwable {
		log.info(target.getClass().getName()+"---"+method.getClass().getName()+"("+Arrays.toString(args)+")---Start");
	}

	
	@Override
	public void afterReturning(Object returnValue, Method method, Object[] args, Object target) throws Throwable {
		log.info(target.getClass().getName()+"---"+method.getClass().getName()+"("+Arrays.toString(args)+")---End");
		
	}

}
